

package com.hazelcast.instance.impl;

import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.instance.impl.executejar.CommandLineJetProxy;
import com.hazelcast.instance.impl.executejar.MemberJetProxy;
import com.hazelcast.jet.JetService;

import javax.annotation.Nonnull;

public final class BootstrappedInstanceProxyFactory {

    private BootstrappedInstanceProxyFactory() {
    }

    public static BootstrappedInstanceProxy createWithCLIJetProxy(@Nonnull HazelcastInstance instance) {
        JetService jetService = instance.getJet();
        CommandLineJetProxy jetProxy = new CommandLineJetProxy(jetService);
        return new BootstrappedInstanceProxy(instance, jetProxy);
    }

    public static BootstrappedInstanceProxy createWithMemberJetProxy(@Nonnull HazelcastInstance instance) {
        JetService jetService = instance.getJet();
        MemberJetProxy jetProxy = new MemberJetProxy(jetService);
        return new BootstrappedInstanceProxy(instance, jetProxy);
    }
}
